var t = 0, a = 0;

Component({
    properties: {
        goodsData: {
            type: null
        },
        handleTag: {
            value: !1,
            type: null
        },
        notap: {
            value: !1,
            type: Boolean
        }
    },
    lifetimes: {
        attached: function() {
            t = 0, a = 0;
        }
    },
    observers: {
        goodsData: function(t) {
            var a = this;
            this.data.imgCount = 0;
            var i = t.every(function(t, i) {
                return JSON.stringify(t) == JSON.stringify(a.data.activitys[i]);
            });
            this.data.handleTag && this.setData({
                activitys: [],
                activitys1: [],
                activitys2: []
            }), t.length > 0 && i ? setTimeout(function() {
                a.setData({
                    activitys: t
                });
            }, 500) : this.setData({
                activitys: t
            });
        }
    },
    data: {
        activitys: [],
        activitys1: [],
        activitys2: [],
        showLoading: !1,
        imgCount: 0
    },
    methods: {
        jumpDetails: function(t) {
            if (!this.data.notap) {
                var a = t.currentTarget.dataset.stickid;
                wx.navigateTo({
                    url: "/packageC/micro_communities/microCommentDetails/microCommentDetails?stickId=" + a
                });
            }
        },
        onImageError: function(t) {
            console.log("图片加载发生错误"), this.onImageLoad({
                currentTarget: {
                    id: t.currentTarget.id
                },
                detail: {
                    width: 160,
                    height: 160
                },
                type: "error"
            });
        },
        onImageLoad: function(i) {
            for (var e = i.currentTarget.id, s = i.detail.width, n = i.detail.height, o = this.data.activitys, r = null, c = s / n, h = 0; h < o.length; h++) if (o[h].id == e) {
                "error" == i.type && o[h].has_many_image[0] && (o[h].has_many_image[0].url = "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/img_404.png"), 
                r = o[h];
                break;
            }
            this.data.imgCount += 1;
            var d = this.data.activitys1, g = this.data.activitys2;
            t <= a ? (t += 176 / c + 60, d.push(r)) : (a += 176 / c + 60, g.push(r));
            var u = {
                activitys1: d,
                activitys2: g
            };
            this.data.imgCount >= this.data.activitys.length && this.setData({
                showLoading: !0
            }), this.setData(u);
        }
    }
});